package com.xicheng.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 书籍表
 * </p>
 *
 * @author com.xicheng
 * @since 2025-09-08
 */
@Getter
@Setter
@ToString
@TableName("books")
@Accessors(chain = true)
public class Books extends Model<Books> {

    /**
     * 书籍ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 关联阶段ID
     */
    @TableField("stage_id")
    private Integer stageId;

    /**
     * 书籍名称
     */
    @TableField("name")
    private String name;

    /**
     * 书籍描述
     */
    @TableField("description")
    private String description;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
